##### My (demuredemeanor) muttrc sub crypto config
# Uses tabstop=4; shiftwidth=4 tabs; foldmarker={{{,}}};
# https://notabug.org/demure/dotfiles
# legacy repo http://github.com/demure/dotfiles
# vim:set syntax=muttrc:

set pgp_use_gpg_agent = yes
set pgp_sign_as=D0289FEDA3059A8C12D74B66FB25CF7F1330AA3D
set pgp_autosign=yes
set crypt_autosign = yes
set crypt_replyencrypt = yes
set crypt_replysignencrypted=yes
set crypt_verify_sig=yes
set pgp_decode_command="gpg %?p?--passphrase-fd 0? --no-verbose --batch --output - %f"
set pgp_verify_command="gpg --no-verbose --batch --output - --verify %s %f"
set pgp_decrypt_command="gpg --no-verbose --batch --output - %f"
set pgp_sign_command="gpg --no-verbose --batch --output - --armor --detach-sign --textmode %?a?-u %a? %f"
set pgp_clearsign_command="gpg --no-verbose --batch --output - --armor --textmode --clearsign %?a?-u %a? %f"
## giving the full path fixes a pgpewrap not found issue
set pgp_encrypt_only_command="/usr/lib/mutt/pgpewrap gpg --batch --quiet --no-verbose --output - --encrypt --textmode --armor --always-trust --encrypt-to D0289FEDA3059A8C12D74B66FB25CF7F1330AA3D -- -r %r -- %f"
set pgp_encrypt_sign_command="/usr/lib/mutt/pgpewrap gpg --batch --quiet --no-verbose --textmode --output - --encrypt --sign %?a?-u %a? --armor --always-trust --encrypt-to D0289FEDA3059A8C12D74B66FB25CF7F1330AA3D -- -r %r -- %f"
set pgp_import_command="gpg --no-verbose --import -v %f"
set pgp_export_command="gpg --no-verbose --export --armor %r"
set pgp_verify_key_command="gpg --no-verbose --batch --fingerprint --check-sigs %r"
set pgp_list_pubring_command="gpg --no-verbose --batch --with-colons --list-keys %r" 
set pgp_list_secring_command="gpg --no-verbose --batch --with-colons --list-secret-keys %r" 
set pgp_good_sign="^gpg: Good signature from"
set pgp_timeout = 3600

### Old Settings ### {{{
## Removing '--passphrase-fd 0'
# This was done as both my smartcard, and just my normal keys would give
# a "gpg: skipped XXXX: bad passphrase" error
# very odd, as it used to work...

#set pgp_decrypt_command="gpg --passphrase-fd 0 --no-verbose --batch --output - %f"
#set pgp_sign_command="gpg --no-verbose --batch --output - --passphrase-fd 0 --armor --detach-sign --textmode %?a?-u %a? %f"
#set pgp_clearsign_command="gpg --no-verbose --batch --output - --passphrase-fd 0 --armor --textmode --clearsign %?a?-u %a? %f"
#set pgp_encrypt_sign_command="/usr/lib/mutt/pgpewrap gpg --passphrase-fd 0 --batch --quiet --no-verbose --textmode --output - --encrypt --sign %?a?-u %a? --armor --always-trust --encrypt-to D0289FEDA3059A8C12D74B66FB25CF7F1330AA3D -- -r %r -- %f"

### End Old ### }}}
